﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EbbinghausWord.Entities;

namespace EbbinghausWord.Controls
{
    public partial class WordListControl : UserControl
    {
        public WordListControl()
        {
            InitializeComponent();
        }

        #region public property
        /// <summary>
        /// 将要显示的单词列表
        /// </summary>
        public List<WordEntity> WordList { get; set; }

        #endregion

        #region callback
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (WordList == null)
            {
                totalTextBlock.Text = "共 0 个";
                return;
            }
            totalTextBlock.Text = string.Format("共 {0} 个", WordList.Count);
            wordListBox.ItemsSource = WordList;
        }

        #endregion
    }
}
